
// #ifndef VUE3
import Vue from 'vue'
import App from './App'
//引入字体图标
import "./static/fonts/index.scss";
Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
    ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import App from './App.vue'
import { createPinia } from 'pinia'
//引入国际化
import i18n  from '@/i18n/index.ts'
import './mock/mock';  // 引入 mock.js 配置文件


import GlobalComponents from '@/plugins/globalComponentsPlugin.ts';  
import GlobalMethodsAndProperties from '@/plugins/globalMethodsAndProperties.ts'; 
// #ifdef APP || H5
// 使用循环注册的方式
import * as directives from "./directives/index"

// #endif


export function createApp() {
  const app = createSSRApp(App)
  app.use(createPinia())
  app.use(GlobalComponents)
  app.use(GlobalMethodsAndProperties)
  app.use(i18n);
  // #ifdef APP || H5
  // 开始遍历注册-自定义指令
  Object.keys(directives).forEach(key => {
    app.directive(key, directives[key])
  })
  // #endif
  return {
    app
  }
}
// #endif